package com.loan.common.enums;

import com.loan.common.utils.StringUtils;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;

/**
 * @author shiguang on 2022/7/21 17:39
 */
public enum PayCompanyEnum {

    ODD_PAY("odd_pay", "ODDPAY"),
    HQ_PAY("hq_pay", "HQPAY"),
    ;

    private final String code;
    private final String info;

    PayCompanyEnum(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static List<HashMap<String, String>> getList() {
        List<HashMap<String, String>> list = new ArrayList<>();
        for (PayCompanyEnum payCompanyEnum : EnumSet.allOf(PayCompanyEnum.class)) {
            HashMap<String, String> map = new HashMap<>();
            map.put("code", payCompanyEnum.code);
            map.put("name", payCompanyEnum.info);
            list.add(map);
        }
        return list;
    }
}
